List of client’s orders
This request retrieves a list of the client’s orders.
Request syntax
GET https://b2b-api.go.yandex.ru/integration/2.0/orders/list?limit=<number of entries>&offset=<number of skipped entries>
&sorting_field={due_date|finished_date}&sorting_direction={1|-1}&since_datetime=<start_date>&till_datetime=<end_date>
Request headers
Authorization: Bearer <OAuth-token>
OAuth access token. The steps to get a token are described in Getting started.
X-YaTaxi-Selected-Corp-Client-Id— client ID from the account. Required if multiple clients are available using the token.
Request parameters
This request can use the following optional parameters:
-
limit: Number of shown entries. If omitted, retrieves information about the first 100 entries. -
offset: Number of skipped entries. If omitted, retrieves information starting with the first entry. -
sorting_field: Field used to sort the retrieved list of orders. Accepts the following values:due_date— beginning with order start date (default),finished_date— beginning with order completion date. -
sorting_direction: Direction of sorting for the retrieved list of orders. Accepts the following values: 1 — ascending, -1 — descending (default). -
since_datetime: Start date used for filtering. Value format:YYYY-MM-DDThh:mm:ss±hhmm. -
till_datetime: End date used for filtering. Value format:YYYY-MM-DDThh:mm:ss±hhmm.
Response fields
The response may contain the following fields:
| Field | Description | Format |
|---|---|---|
items |
List of client’s orders. | Array of objects |
limit |
Maximum number of returned entries. | Number |
offset |
Number of skipped entries. | Number |
total_amount |
Number of returned entries. | Number |
Structure of the items array elements:
| Field | Description | Format |
|---|---|---|
id |
Order ID. | String |
user_id |
Employee ID. | String |
class |
Tariff name. | String |
status |
Order status. | String |
source |
Starting route point. | Object |
interim_destinations |
Transitional route points. | Object |
destination |
Route destination point. | Number |
cost_center_values |
New cost center fields. | Array of objects |
due_date |
Order start date. Value format: YYYY-MM-DDThh:mm:ss±hhmm |
String |
finished_date |
Order end date. Is returned only for completed orders. Value format: YYYY-MM-DDThh:mm:ss±hhmm |
String |
cost |
Cost without VAT. Is returned only for completed orders. | Number |
cost_with_vat |
Cost with VAT. Is returned only for completed orders. | Number |
Structure of the source-destination object:
| Field | Description | Format |
|---|---|---|
geopoint |
An array of two values that determine the longitude and latitude of the point. | Array fullname |
Structure of the cost_center_values array element:
| Field | Description | Format |
|---|---|---|
id |
Cost center field ID. | String |
title |
Cost center field name. | String |
value |
New field value. | String |
Request example
GET https://b2b-api.go.yandex.ru/integration/2.0/orders/list?limit=5&offset=0&sorting_field=due_date&sorting_direction=1
...
Authorization: <OAuth-token>
Response example
An example response to this request looks like this:
{
"items": [
{
"id": "507...1db",
"user_id": "035...c71",
"status": "cancelled",
"class": "business",
"source": {
"fullname": "Moscow, Novaya Bashilovka St., 10",
"geopoint": [
37.56997813720699,
55.78798846490584
]
},
"destination": {
"fullname": "Moscow, Savodaya-Kudrinskaya St., 15 bld 9",
"geopoint": [
37.58542766113278,
55.76496146265227
]
},
"cost_center_values": [
{
"id": "cost_center",
"title": "Trip goal",
"value": ""
}
],
"due_date": "2023-02-08T10:54:41+03:00",
"finished_date": "2023-02-08T10:51:37.759000+03:00",
"cost": 0,
"cost_with_vat": 0
},
{
"id": "b99...dc17",
"user_id": "035...c71",
"status": "complete",
"class": "business",
"source": {
"fullname": "Moscow, Bolshaya Sadovaya St., 14 bld 9",
"geopoint": [
37.59538402099606,
55.76728413277445
]
},
"destination": {
"fullname": "Moscow, Krobeynikov lane, 1",
"geopoint": [
37.5998472167968,
55.73785337560665
]
},
"cost_center_values": [
{
"id": "9af...12a",
"title": "Trip goal",
"value": "business"
}
],
"due_date": "2023-02-08T17:50:36+03:00",
"finished_date": "2023-02-08T17:56:17.442000+03:00",
"cost": 345,
"cost_with_vat": 414
}
],
"limit": 5,
"offset": 0,
"total_amount": 2
}
Response codes
The response to this request may contain the following HTTP codes:
200: Request completed successfully.403:- SELECT_CLIENT_HEADER_REQUIRED: the request did not pass the header
X-YaTaxi-Selected-Corp-Client-Id(returned if more than one client is available for the token). - SELECTED_CLIENT_ACCESS_DENIED: the header
X-YaTaxi-Selected-Corp-Client-Idcontains the client's ID, which this login does not have access to.
- SELECT_CLIENT_HEADER_REQUIRED: the request did not pass the header